package geotrans.midlet;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class Startup extends MIDlet implements CommandListener {

    private Display display;

    public Startup() {
    }

    private void initMIDlet() {
        display = Display.getDisplay(this);

        MainForm form = new MainForm();


        display.setCurrent(form);
        //new SplashScreen(display, new Main(display, this));
    }

    protected void startApp() throws MIDletStateChangeException {
        if (display == null) {
            // first time called...
            initMIDlet();
        }
    }

    class MainForm extends Form
    {
        MainForm()
        {
            super("MGeoTrans");
            append("Seja bem vindo ao GeoTrans.");
            append(new TextField("label:", null, 100, 5));
            // comandos
            Command exitCommand = new Command("Sair", Command.EXIT, 1);
            addCommand(exitCommand);
            setCommandListener(Startup.this);
        }
    }

    protected void destroyApp(boolean unconditional) throws MIDletStateChangeException {
        exitMIDlet();
    }

    protected void pauseApp() {
    }

    public void exitMIDlet() {
        notifyDestroyed();
    }

    public void commandAction(Command c, Displayable d) {
        exitMIDlet();
    }
}

